<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://unpkg.com/vue@next"></script>
<div id="app">
    <ul>
        <li v-for="item in items" key="item.key">
            {{item.message}}
        </li>
    </ul>
</div>
<script>
    const vueOpt = {
        data(){
            return {
                items: [{message: 'hello', id:1}, {message:'world', id:2}]
            }
        },

        mounted() {
            setTimeout(()=>{
                // 数组的变更方法，自动触发视图更新
                this.items.push({message:'kenny', id:3})
            }, 1000)
        }

    }

    Vue.createApp(vueOpt).mount('#app')
</script>
</body>
</html>
